package com.example.chenfenweb.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.chenfenweb.entity.SysTemplateManager;
import com.example.chenfenweb.mapper.SysTemplateManagerMapper;
import com.example.chenfenweb.service.ISysTemplateManagerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

/**
 * @Description: 模板管理
 * @Author: jeecg-boot
 * @Date:   2024-06-22
 * @Version: V1.0
 */
@Service
public class SysTemplateManagerServiceImpl extends ServiceImpl<SysTemplateManagerMapper, SysTemplateManager> implements ISysTemplateManagerService {

    @Autowired
    SysTemplateManagerMapper   sysTemplateManagerMapper;


    @Override
    public SysTemplateManager getTemplateByStatus(String status) {
        QueryWrapper<SysTemplateManager>  queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("del_flag","0");
        queryWrapper.eq("template_status",status).last("limit 1");
        return sysTemplateManagerMapper.selectOne(queryWrapper);
    }
}
